import isValidKey from "../../isValidKey";

export function getInterfaceRoute(name: string) {
  if(isValidKey(name, interfaceRoute)) {
    return interfaceRoute[name];
  }
  else {
    throw console.error();
  }
}

const URL = {
  develop: 'https://sanli-tracks.com/sanlia',
  product: 'https://sanli-tracks.com/sanli',
  local: 'http://127.0.0.1/sanli',
}
export const url = URL.develop;
// export const url = URL.product;
// export const url = URL.local;

// 开发环境
const ENV = url + '/index.php?r=';
// 选择环境
const DOMAIN = ENV;
// const DOMAIN = ENV.product;

// 接口地址
const interfaceRoute = {
  GetUserInfo2: DOMAIN + 'WxUser/GetUserInfo2',
  activitytype: DOMAIN + 'WxUser/activitytype',
  CourseCheck: DOMAIN + 'WxCourse/CourseCheck',
  GetMoreNews: DOMAIN + 'WxCourse/GetMoreNews',
  GetClubNews: DOMAIN + 'WxCourse/GetClubNews',
  Advertisement: DOMAIN + 'WxOther/Advertisement',
  ParentGetStuActivityDetail: DOMAIN + 'WxSign/ParentGetStuActivityDetail',
  UpGps: DOMAIN + 'WxOther/UpGps',
  GetTeaUpGps: DOMAIN + 'WxOther/GetTeaUpGps',
  ActiveStuDetail: DOMAIN + 'WxSign/ActiveStuDetail',
  GetStuUpGps: DOMAIN + 'WxOther/GetStuUpGps',
  TeaNowCourse: DOMAIN + 'WxSign/TeaNowCourse',
  GpsRequest: DOMAIN + 'WxOther/GpsRequest',
  DailyDetail: DOMAIN + 'WxSign/DailyDetail',
  GetKidsDailyDetail: DOMAIN + 'WxSign/GetKidsDailyDetail',
  getOpenId: DOMAIN + 'WxUser/getOpenId',
  GetUserInfo: DOMAIN + 'WxUser/GetUserInfo',
  UpdateStuComment: DOMAIN + 'WxCourse/UpdateStuComment',
  UpdateBaseClubComment: DOMAIN + 'WxCourse/UpdateBaseClubComment',
  GetBaseClub: DOMAIN + 'WxCourse/GetBaseClub',
  GetMyApply: DOMAIN + 'WxOther/GetMyApply',
  GetStuApply: DOMAIN + 'WxOther/GetStuApply',
  GetKidsList: DOMAIN + 'WxUser/GetKidsList',
  GetStudentList: DOMAIN + 'WxUser/GetStudentList',
  GetSchoolAndClass: DOMAIN + 'WxUser/GetSchoolAndClass',
  tgReverse: DOMAIN + 'WxSign/tgReverse',
  DropRecord: DOMAIN + 'WxSign/orderisshow', // 逻辑删除
  GetKidsActivity: DOMAIN + 'WxCourse/GetKidsActivity',
  GetMyAct: DOMAIN + 'WxOther/GetMyAct',
  GetDiff: DOMAIN + 'WxOther/GetDiff',
  GetDetail: DOMAIN + 'WxOther/GetDetail',
  CouponCheck: DOMAIN + 'WxSign/CouponCheck',
  orderFind: DOMAIN + 'WxSign/orderFind',
  tgPay: DOMAIN + 'WxSign/tgPay',
  GetOrderDetail: DOMAIN + 'WxSign/GetOrderDetail',
  SearchKids: DOMAIN + 'WxUser/SearchKids',
  GetKidsName: DOMAIN + 'WxUser/GetKidsName',
  KidBindParent: DOMAIN + 'WxUser/KidBindParent',
  SearchParent: DOMAIN + 'WxUser/SearchParent',
  GetParentList: DOMAIN + 'WxUser/GetParentList',
  Register: DOMAIN + 'WxUser/Register',
  CheckRole: DOMAIN + 'WxSign/CheckRole',
  schoollist: DOMAIN + 'Wxother/schoollist',
  DeleteOneOrderByPk: DOMAIN + 'WxSign/DeleteOneOrderByPk',
  GetTeacher: DOMAIN + 'WxOther/GetTeacher',
  GetTeaAct: DOMAIN + 'WxOther/GetTeaAct',
  GpsAccept: DOMAIN + 'WxOther/GpsAccept',
  isShow: DOMAIN + 'WxSign/isShow',
  Teasign: DOMAIN + 'WxSign/Teasign',
  Comment: DOMAIN + 'WxCourse/Comment',
  Stusign: DOMAIN + 'WxSign/Stusign',
  Clubdetail: DOMAIN + 'WxCourse/Clubdetail',
  GetActDetail: DOMAIN + 'WxCourse/GetDetail',
  GetClubActivity: DOMAIN + 'WxOther/GetClubActivity',
  CourseDailyDetail: DOMAIN + 'WxCourse/DailyDetail',
  GetTeaReviewAct: DOMAIN + 'WxOther/GetTeaReviewAct',
  GetTeacherDetail: DOMAIN + 'WxSign/GetTeacherDetail',
  TeaUpGps: DOMAIN + 'WxOther/TeaUpGps',
  UpdateOneOrder: DOMAIN + 'WxSign/UpdateOneOrder',
  UpdateUserInfo: DOMAIN + 'WxUser/UpdateUserInfo', // 更新个人信息
  GetCourse: DOMAIN + 'WxCourse/GetMoreNews', // 获取课程列表
  SignOut: DOMAIN + 'WxUser/unbond', // 退出登录（清空openid）
  TeacherCancelApply: DOMAIN + 'WxSign/CancelRegistration', // 导师取消报名
  UploadMoreImg: DOMAIN + 'WxUser/SaveMoreImg', // 上传保存更多图像（粤康码）
  GetMoreImg: DOMAIN + 'WxUser/GetMoreFile', // 获取订单的出行人图片补充资料
  UpdateMoreImg: DOMAIN + 'WxUser/ChangeMoreFile', // 更新补充图片资料
  // GetOrderDetail: DOMAIN + 'WxSign/GetDetail',
  // GetTeaReviewAct: DOMAIN + 'WxOther/GetTeaReviewAct',
  // GetTeacherDetail: DOMAIN + 'WxSign/GetTeacherDetail',
}

export const CURRENT_DOMAIN = DOMAIN; // 当前服务器URL